#include <stdio.h>

union little_big_end
{
 short x16;
 long y32;
};

int main(void)
{
 union little_big_end lbe;

 printf("the size of lbe=%d\n",sizeof(lbe));

 lbe.y32 = 0x12345678;

 if(lbe.x16 == 0x1234 )
 {
  printf("the memory format is big end!\n");
 }
 else if(lbe.x16 == 0x5678 )
 {
  printf("the memory format is little end!\n");
 }

 getchar();

 return 0;
}
